package com.naiterui.ehp.bs.patient.vo.im;

public class Message<T> {

    protected static final int MESSAGE_TYPE_TEXT = 1;
    protected static final int MESSAGE_TYPE_IMG = 2;

    private Integer lastPlatform;
    private long sendTime;
    private Session session;
    private User from;
    private User to;
    private Integer type;
    private Extend exd;
    private Long inquirerId;
    private T content;

    public Message(Integer lastPlatform, String sessionId, Long fromId, Long toId, Integer type) {
        super();
        this.lastPlatform = lastPlatform;
        this.sendTime = System.currentTimeMillis();
        this.session = new Session(sessionId);
        this.from = new User(fromId);
        this.to = new User(toId);
        this.type = type;
    }

    public Message(Integer lastPlatform, long sendTime, Session session, User from, User to, Integer type,
        Extend exd, Long inquirerId,T content) {
        this.lastPlatform = lastPlatform;
        this.sendTime = sendTime;
        this.session = session;
        this.from = from;
        this.to = to;
        this.type = type;
        this.exd = exd;
        this.inquirerId = inquirerId;
        this.content = content;
    }

    public Message() {
    }

    public Integer getLastPlatform() {
        return lastPlatform;
    }

    public void setLastPlatform(Integer lastPlatform) {
        this.lastPlatform = lastPlatform;
    }

    public long getSendTime() {
        return sendTime;
    }

    public void setSendTime(long sendTime) {
        this.sendTime = sendTime;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public User getFrom() {
        return from;
    }

    public void setFrom(User from) {
        this.from = from;
    }

    public User getTo() {
        return to;
    }

    public void setTo(User to) {
        this.to = to;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getInquirerId() {
        return inquirerId;
    }

    public void setInquirerId(Long inquirerId) {
        this.inquirerId = inquirerId;
    }

    static class Session {
        private String sessionId;

        Session(String sessionId) {
            this.sessionId = sessionId;
        }

        public String getSessionId() {
            return this.sessionId;
        }

        public void setSessionId(String sessionId) {
            this.sessionId = sessionId;
        }
    }

    static class User {
        private Long id;

        User(Long id) {
            this.id = id;
        }

        public Long getId() {
            return this.id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        @Override
        public String toString() {
            return "User{" + "id=" + id + '}';
        }
    }

    public static class Extend {
        public static final int CONSULT_PAY_TYPE_ACTIVITY = 2;// 活动付费

        private Boolean ignoreCharge;// 向微信发送消息是否忽略会话

        /**
         * 付费咨询支付状态 0-免费,1-付费,2-活动付费
         */
        private Integer consultPayStatus;
        private Integer consultSourceType;
        private String summary;// 消息摘要
        private String diseaseId;// 病情ID

        public Boolean getIgnoreCharge() {
            return ignoreCharge;
        }

        public void setIgnoreCharge(Boolean ignoreCharge) {
            this.ignoreCharge = ignoreCharge;
        }

        public Integer getConsultPayStatus() {
            return consultPayStatus;
        }

        public void setConsultPayStatus(Integer consultPayStatus) {
            this.consultPayStatus = consultPayStatus;
        }

        public String getSummary() {
            return summary;
        }

        public void setSummary(String summary) {
            this.summary = summary;
        }

        public Integer getConsultSourceType() {
            return consultSourceType;
        }

        public void setConsultSourceType(Integer consultSourceType) {
            this.consultSourceType = consultSourceType;
        }

        public String getDiseaseId() {
            return diseaseId;
        }

        public void setDiseaseId(String diseaseId) {
            this.diseaseId = diseaseId;
        }
    }

    @Override
    public String toString() {
        return "Message [lastPlatform=" + lastPlatform + ", sendTime=" + sendTime + ", session="
                + session + ", from=" + from + ", to=" + to + ", type=" + type + ", exd=" + exd
                + ", content=" + content + "]";
    }

    public Extend getExd() {
        return exd;
    }

    public void setExd(Extend exd) {
        this.exd = exd;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }
}